package com.waiting.dynamic.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @Description 调用处理器
 * @Author bjweitingting
 * @Date 2019/2/25
 **/
public class MyInvocationHandler implements InvocationHandler {

    Object object;

    MyInvocationHandler(Object object) {
        this.object = object;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("MyInvocationHandler invoke begin");
        method.invoke(object, args);
        System.out.println("MyInvocationHandler invoke end");
        return null;
    }
}
